{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>
    <div class="form-group">
        <label class="col-sm-2 control-label">所属商家</label>
        <div class='col-sm-8'>
            <select name='sid' class='layui-select full-width' lay-ignore>
                <option value='0'>---请选择---</option>
                <!--{foreach $data as $menu}-->
                <!--{eq name='menu.id' value='$vo.sid|default=0'}-->
                <option selected value='{$menu.id}'>{$menu.store_name}</option>
                <!--{else}-->
                <option value='{$menu.id}'>{$menu.store_name}</option>
                <!--{/eq}-->
                <!--{/foreach}-->
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">商品名称</label>
        <div class='col-sm-8'>
            <input autofocus name="sname" value='{$vo.sname|default=""}' required="required" title="商品名称" placeholder="商品名称" class="layui-input">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">商品价格(元)</label>
        <div class='col-sm-8'>
            <input type="number" name="sprice" value='{$vo.sprice|default=""}' required="required" title="商品价格" placeholder="商品价格" class="layui-input">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">商品封面图</label>
        <div class='col-sm-8'>
            <div class="col-sm-9 padding-left-0">
                <input style="border-right:none" name="simage" value="{$vo.simage|default=''}" class="layui-input" title="请输入链接或上传图片文件" placeholder="请输入链接或上传图片文件">
            </div>
            <div class="col-sm-3 padding-left-0">
                <button data-file="one"  data-field="simage" type="button" class="layui-btn layui-btn-sm" style="height:38px;line-height:38px;width:100%">上传图片文件</button>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label label-required">商品详情图</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>图片</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top">
                        <input type="hidden" name="simagelist" value="{$vo.simagelist|default=''}">
                        <script>$('[name=simagelist]').uploadMultipleImage()</script>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">商品描述</label>
        <div class='col-sm-8'>
            <textarea placeholder="请输入商品描述" title="请输入商品描述" class="layui-textarea" name="sdesc">{$vo.sdesc|default=""}</textarea>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">保存配置</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <script>
        /*! 实例富文本编辑器  */
        require(['ckeditor'], function () {
            window.createEditor('[name="content"]', {height: 500});
        });
    </script>
</form>
{/block}